#!/bin/make

CC=g++
CFLAGS=-Wall
LDFLAGS=-lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
HEADERS=Animation.h Ui/Widget/Button.h Character.h Ui/Widget/CheckBox.h Entity.h Ui/Manager.h ImageManager.h ImageWrap.h Include.h Item.h Ui/Widget/Label.h Ui/Widget/LineEdit.h Map/Map.h Ui/Widget/RadioBox.h Rectangle.h Singleton.h Ui/Widget/Slider.h SoundManager.h SoundWrap.h System.h TextManager.h Map/Tile.h Ui/Widget.h Ui/WidgetType.h
SRC=Animation.cpp Ui/Widget/Button.cpp Character.cpp Ui/Widget/CheckBox.cpp Entity.cpp Ui/Manager.cpp ImageManager.cpp ImageWrap.cpp Item.cpp Ui/Widget/Label.cpp Ui/Widget/LineEdit.cpp main.cpp Map/Map.cpp Ui/Widget/RadioBox.cpp Ui/Widget/Slider.cpp SoundManager.cpp SoundWrap.cpp System.cpp TextManager.cpp Ui/Widget.cpp
OBJ=$(SRC:.cpp=.o)
BIN=PickinOpenSticks-Linux

release: $(OBJ)
	$(CC) -O3 -ffast-math $(LDFLAGS) $(OBJ) -o $@

debug: $(OBJ)
	$(CC) -ggdb $(LDFLAGS) $(OBJ) -o $@

clean:
	rm *.o Map/*.o Ui/*.o Ui/Widget/*.o;

$(BIN): $(OBJ)
	$(CC) $(LDFLAGS) $(OBJ) -o $@

# because you never know which source file includes which header
$(SRC): $(HEADERS)

.cpp.o:
	$(CC) -c $(CFLAGS) $< -o $@
